<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"   %>
<script>

	var userPersonDia;
	var userPersonFrom;
	$(function(){
		userPersonFrom = $('#userPersonFrom').form('load',ctx+'/sys/user/get.htm?id=${userRoleInfo.user_id}');
		userPersonDia = $('#userPersonDia').show().dialog({
			modal : true,
			title : '用户信息',
			buttons : [ {
				text : '确定',
				handler : function() {
					var data=JSON.stringify(userPersonFrom.form("serialize"));
					$("input[name=data]").val(data);
					$("input[name=user_id]").val("${userRoleInfo.user_id}");
					userPersonFrom.form('submit', {
						url : ctx+'/sys/user/saveInfo.htm'
						/*,
						success : function(){
						try {
							$.messager.show({
								msg : '编辑成功！',
								title : '提示'
							});
							userPersonDia.dialog('close');
						} catch (e) {
								$.messager.show({
									msg : '用户名称已存在！',
									title : '提示'
								});
							}
						}*/
					});
					$.messager.show({
						msg : '编辑成功！',
						title : '提示'
					});
					userPersonDia.dialog('close');
				}
			} ,{
				text : '取消',
				handler : function() {
					userPersonDia.dialog('close');
				}
			} ]
		}).dialog('close');
	});
	function openInfo(){
		userPersonDia.dialog('open');
		$("#userPersonFrom input[name=password]").val("");
	}
	function loginOff(flag){
		if(flag==2){
			$.cookie('usercode', null,{path:"/"});
			$.cookie('password', null,{path:"/"});
			$.cookie('rmb', null,{path:"/"});
			$.cookie('easyuiThemeName', null,{path:"/"});
		}
		location.href=ctx+'/sys/user/loginOff.htm';
	}
	function myopen(jq,callback){
		  $(jq).window({
		    onClose:function(){
		      $(this).window("destroy");
		    }
		  });
		  if(callback){
		    callback.call(jq);
		  }
	}
</script>
<div class="toolbar" align="right" >
	<div style="padding:5px;">
		<a href="javascript:void(0)" id="mb1" class="easyui-menubutton" data-options="menu:'#mm1',iconCls:'icon-appcas',plain:false">个人设置</a>
		<a href="javascript:void(0)" id="mb2" class="easyui-menubutton" data-options="menu:'#mm2',iconCls:'icon-logout',plain:false">退出</a>
	</div>
	<div id="mm1" style="width:100px;">
		<div data-options="iconCls:'icon-user'" onclick="openInfo()" >个人信息</div>
		<div class="menu-sep"></div>
		<div>
			<span>界面风格</span>
			<div style="width:120px;">
				<div onclick="javascript:changeThemeFun('default');">default</div>
				<div onclick="javascript:changeThemeFun('cupertino');">cupertino</div>
				<div onclick="javascript:changeThemeFun('gray');">gray</div>
				<div onclick="javascript:changeThemeFun('pepper-grinder');">pepper-grinder</div>
				<div onclick="javascript:changeThemeFun('sunny');">sunny</div>
			</div>
		</div>
	</div>
	<div id="mm2" style="width:100px;">
		<div  onclick="loginOff(1)" title="保留登录信息" >退出</div>
		<div  onclick="loginOff(2)" title="删除登录信息" >注销</div>
	</div>
	
</div>

<div>
${userRoleInfo.user_name}【${userRoleInfo.role_name}】你好，${userRoleInfo.login_date} 登录成功
</div>
 <div id="userPersonDia"  style="display: none;overflow: hidden;" >
 	<form id="userPersonFrom" method="post">
		 <input name="user_id" type="hidden" />
		 <input name="data" type="hidden" />
			<table class="tableForm">
				<tr>     
                   <td style="width:70px;" >帐号：</td>
                    <td style="width:150px;">    
                        <input name="user_code"  readonly="readonly" style="background-color:khaki"  />
                    </td>
                   <td style="width:70px;" >名字：</td>
                    <td style="width:150px;">    
                        <input name="user_name" readonly="readonly" style="background-color:khaki" />
                    </td>
                </tr>
               <tr>
                    <td style="width:70px;">密码：</td>
                    <td style="width:150px;" title="如果不更改密码,请留空!">    
                        <input name="password" id="password" type="password" />
                    </td>
                    <td style="width:70px;">邮箱：</td>
                    <td style="width:150px;">    
                        <input name="email" class="easyui-validatebox" data-options="required:true"  validType="email" />
                    </td>
                </tr>      
			</table>
		</form>
 </div>
<div id="userOnLineDia" style="display: none;overflow: hidden;">
  	<table id="userOnLineGrid"   ></table>
</div>
